import Vue from 'vue'
import Vuex from 'vuex'

import vuexPersist from "vuex-persist"
Vue.use(Vuex)
const Vuexlocal = new vuexPersist({
  storage: window.sessionStorage,
  key: '05B_vuex',
})

export default new Vuex.Store({
  state: {
    name: {},
    token: '',
  },
  mutations: {
    submitForm(state, data) {
      state.name = data;
      state.token = data.token;
    },
    tuichu(state){
      state.token = []
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [Vuexlocal.plugin],
})
